#FROM maven:3.5-jdk-8-alpine AS builder
#
## Copy local code to the container image.
#WORKDIR /app
#COPY pom.xml .
#COPY src ./src
#
## Build messagePrivateRequest release artifact.
#RUN mvn package -DskipTests
#
## Run the web service on container startup.
#CMD ["java","-jar","/app/target/yupao-backend-0.0.1-SNAPSHOT.jar","--spring.profiles.active=prod"]



# 使用官方的 Java 8 镜像作为基础镜像
FROM openjdk:8-jdk

# 设置工作目录
WORKDIR /app

# 将本地的 JAR 文件复制到镜像中的 /app 目录
COPY ./target/yupao-backend-0.0.1-SNAPSHOT.jar yupao-backend-0.0.1-SNAPSHOT.jar

# 暴露容器的端口，与 Spring Boot 应用的端口一致
EXPOSE 8080

# 在容器启动时运行 Spring Boot 应用
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app/app.jar"]
